using System.Collections;
using Microsoft.Xna.Framework.Graphics;
using Tomahawk.Runtime.Scene;
using System.Collections.Generic;

namespace Tomahawk.Runtime.Rendering
{

    public class PostProcessorManager
    {

        private PostProcessor postProcessor;

        public void PreRender(GraphicsDevice device)
        {
            if (this.postProcessor != null)
                postProcessor.PreRender(device);
        }

        public void PostRender(GraphicsDevice device)
        {
            if (this.postProcessor != null)
                postProcessor.PostRender(device, null);
        }

        /// <summary>
        /// Add a new processor to the chain
        /// </summary>
        public void SetPostProcessor(PostProcessor parentProcessor, PostProcessor newProcessor)
        {
            parentProcessor.setNextProcessor(newProcessor);
        }

        /// <summary>
        /// Add a new processor as root
        /// </summary>
        public void SetPostProcessor(PostProcessor newProcessor)
        {
            this.postProcessor = newProcessor;
        }
    }

}
